import { messages } from "share/common";
import React from "react";
import { Button } from "antd";
import SlideFrame from "components/slide-frame";
import ContractAuthorize from "./contract-authorize";

function onAuthorize(contractHeaderId, context) {
  SlideFrame.open(
    {
      title: messages("finance-6.key144") /*授权信息*/,
      content: ContractAuthorize,
      width: 800,
      params: { contractHeaderId },
      hasFooter: true,
    },
    context
  );
}

class AuthorizeBtn extends React.Component {
  render() {
    const { contractHeaderId } = this.props;
    return (
      <Button ghost type="primary" onClick={() => onAuthorize(contractHeaderId, this)} className="button-left-half">
        {messages("finance-6.key145") /*授权*/}
      </Button>
    );
  }
}

export default AuthorizeBtn;
